//
// Created by 86186 on 2021/12/8.
//

#ifndef FFMPEG_AVPACKETQUEUE_H
#define FFMPEG_AVPACKETQUEUE_H

#include "../config.h"
#include <queue>
#include "mutex"

extern "C" {
#include "../include/libavformat/avformat.h"
#include "../include/libswresample/swresample.h"
#include "../include/libavcodec/avcodec.h"
};

using namespace std;

class AVPacketQueue {
private:
    queue<AVPacket *> queue;
public:
    mutex &qMutex;
    condition_variable &cv;
    AVPacketQueue() = delete;
    AVPacketQueue(mutex &qMutex, condition_variable &cv);
    ~AVPacketQueue() {};
    int push(AVPacket *avPacket);
    AVPacket *pop();
    int size();
};


#endif //FFMPEG_AVPACKETQUEUE_H
